package com.alex.algorithm.easy;

import lombok.Data;

@Data
public class BinaryTreeNode {
    private BinaryTreeNode parent;
    private BinaryTreeNode left;
    private BinaryTreeNode right;

    private int value;

    public void traverse(BinaryTreeNode node){
        if (node != null){
            System.out.println(node.getValue());
        }
        if (node.getLeft() != null) {
            traverse(node.getLeft());
        }
        if (node.getRight() != null) {
            traverse(node.getRight());
        }
    }
}
